<!--
 * @description  :
 * @descriptionDetail:
 * @copyright    : 浙江烟草
 * @author       : mhb
 * @create       : 2023-01-17 11:06:06
-->
/**
 * @description  : 无证户档案详情
 * @descriptionDetail : 无证户档案详情
 * @copyright    : 浙江烟草
 * @author       : mc
 * @create       : 2022-12-05 14:55:21
 */
<template>
  <view class="page">
    <!-- #ifdef H5-ONLY -->
    <theme-navbar :is-white="false" backText="返回" title="无证户档案详情" :custom-back="goBack">
    </theme-navbar>
    <!-- #endif -->
    <!-- 内容 -->
    <view class="u-page">
      <view v-show="current == 0">
        <base-info :baseInfo="baseInfo" :picList="fileList"></base-info>
      </view>
      <view v-show="current == 1">
        <managenent-info :baseInfo="baseInfo"></managenent-info>
      </view>
      <view v-show="current == 2">
        <person-info :retailerUuid="unlicenseId"></person-info>
      </view>
      <view v-show="current == 3">
        <check-record :retailerUuid="unlicenseId"></check-record>
      </view>
			<view v-show="current == 4">
			  <visit-info :retailerUuid="unlicenseId"></visit-info>
			</view>
      <view v-show="current == 5">
        <illegal-record :retailerUuid="unlicenseId"></illegal-record>
      </view>
      <view v-show="current == 6">
        <relation-info :retailerUuid="unlicenseId"></relation-info>
      </view>
      <view v-show="current == 7">
        <source-goods :retailerUuid="unlicenseId"></source-goods>
      </view>
      <view v-show="current == 8">
        <business-handle :retailerUuid="unlicenseId"></business-handle>
      </view>
      <view v-show="current == 9">
        <storage-info :retailerUuid="unlicenseId"></storage-info>
      </view>
    </view>
    <!-- <u-gap height="80" bg-color="#fff"></u-gap> -->
    <!-- 底部栏 -->
    <u-tabbar
      :list="tabList"
      bg-color="#e9e9e9"
      :inactive-color="inactiveColor"
      :activeColor="activeColor"
      v-model="current"
      @change="changeTab"
    ></u-tabbar>
  </view>
</template>

<script>
import MescrollMoreMixin from "@/components/mescroll-uni/mixins/mescroll-more.js";
import MeTable from '@/components/me-table.vue';
import baseInfo from "./detailCommon/baseInfo";
import managenentInfo from "./detailCommon/managenentInfo";
import personInfo from "./detailCommon/personInfo";
import visitInfo from "./detailCommon/visitInfo";
import checkRecord from "./detailCommon/checkRecord";
import illegalRecord from "./detailCommon/illegalRecord";
import relationInfo from "./detailCommon/relationInfo";
import sourceGoods from "./detailCommon/sourceGoods";
import businessHandle from "./detailCommon/businessHandle";
import queryService from "@/service/check/query.service"
import certificateService from "@/service/certificate/certificate.service.js";
import checkService from "@/service/check/check.service";
import {PATHROOT,} from '@/common/path.config';
const IMG_LIST = ['image/gif', 'image/jpg', 'image/jpeg', 'image/bmp', 'image/png',];
import storageInfo from "./detailCommon/storageInfo";
export default {
  components: {
    baseInfo,
    managenentInfo,
    personInfo,
		visitInfo,
    checkRecord,
    illegalRecord,
    relationInfo,
    sourceGoods,
    businessHandle,
    storageInfo,
  },
  mixins: [MescrollMoreMixin,],
  data() {
    return {
      scrollTop: 0,
      inactiveColor: '#909399',
      activeColor: '#5098FF',
      current:0,
      user: this.$storage.get(this.$rp.common.USER),
      retailerInfo:{},
      retailerUuid:'',
      licNo:'',
      tabList:[{
        text: '基础',
      },{
        text: '经营',
      },{
        text: '人员',
      },{
        text: '监管',
      },{
        text: '走访',
      },{
        text: '处罚',
      },{
        text: '关联',
      },{
        text: '货源',
      },{
        text: '办证',
      },{
        text: '仓储',
      },],
      tels:[],
      unlicenseId:'',  // 无证户主键id
      baseInfo:{}, // 基本信息
      picTypeList: IMG_LIST, // 图片类型集合
      fileList:[],
    };
  },
  onLoad(options){
    this.unlicenseId = this.getRouteParam().retailerUuid || '22110912325646426306';
    console.log(this.unlicenseId);
    this.init();
  },
  methods: {
    getListViewHeight() {
      let p = this.$u.sys().windowHeight - 44 - uni.upx2px(180) - this.$u.sys().statusBarHeight + 'px';
      return p;
    },
    init(){
      this.$u.loading('正在加载...');
      // this.$FILE_GROUP_TYPE.m_unlicense_attr  编码暂时注释
      Promise.all([
        queryService.unlicenseInfo({retailerUuid:this.unlicenseId,}),
        certificateService.goFiles(this.unlicenseId,),
      ]).then(res => {
        this.$u.hideLoading();
        this.baseInfo = res[0].bean;
        this.picList = res[1].data;
        this.fileList = this.picList.map((f) => {
          f.uid = f.fileId = f.gfiId;
          f.name = f.gfiAlis + (this.showUploader ? `（${f.gfiUser}）` : '');
          // f.status = 'done';
          // f.size = f.gfiSize;
          f.image = queryService.previewImg(f.gfiId);
          if (this.picTypeList.join(',').indexOf(f.gfiSuffix) != -1) {
            f.type = 'image/' + f.gfiSuffix;
          }
          return f;
        });
      })
    },
    changeTab(index){
      this.$u.getRect('.u-page').then(res => {
        uni.pageScrollTo({
          scrollTop: 0,
          duration: 0,
        })
      })
      this.current = index;
    },
  },
};
</script>

<style lang="scss" scoped>
@import "style/certificate/common.scss";
.page{
	padding: 0;
	padding-bottom: 50px;
}
.zk-list{
  padding:15px 10px;
  .zk-title{
    padding-bottom: 10px;
  }
  .zk-row{
    display: flex;
    justify-content: space-between;
    color:#808080;
    line-height: 26px;
    padding: 10px 0;
  }
  .zk-desc{
    padding-bottom: 10px;
    display: inline-flex;
    width:100%;
    color:	#606266;
    .desc-tit{
      width: 86%;
    }
  }
  .zk-dir{
    display: flex;
    flex-direction: column;
    .cont-style{
        font-size: 26rpx;
        padding:5px 0px;
        font-weight: bold;
    }
    .tit-style{
      font-size: 26rpx;
    }
  }
}
.re-list{
  padding:15px 10px;
  color:#666666;
  font-size:15px;
  border-bottom: 1px solid #E9E9E9;
  display:flex;
  flex-direction: row;
  justify-content: flex-start;
  -webkit-flex-direction: row;
  .re-media{
  padding-right: 10px;
  vertical-align: middle;
}
.re-content{
  width:100%;
  .re-manager{
    display: flex;
    justify-content: space-between;
      .re-title{
        font-size: 15px;
        color: #666;
        font-weight: 600;
            margin-bottom: 5px;
        }
  }
.re-subtitle{
    padding-top:5px;
    color: #666;
  }
.re-icon{
    display: flex;
    padding-top: 10px;
}
}
}
.il-list{
  line-height: 24px;
  padding:15px 10px;
  .il-row{
    display: flex;
    justify-content: space-between;
    color:#808080;
  }
  .il-title-row{
    display: flex;
    justify-content: flex-start;
    color:#808080;
    .il-50{
      width:50%;
    }
  }
}
.il-subTitle{
    color: #000;
  }
/deep/.u-tabbar__content__item__text{
    bottom: auto;
    font-size: 14px;
  }
</style>
